<?php
require_once 'Controller.php';

class Templateable extends Controller {
	public function __construct() {
		parent::__construct();
	}
		
	public function loadTemplate($class, $method) {
		$file = "tpl/$class/$method.tpl";
		if(file_exists($file)) {
			if(is_readable($file)) {
				include ($file);
			}
		}
	}
	
	public function postAction($method) {
		$class = get_class($this);
		$this->loadTemplate($class, $method);
	}
}
